/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * MDIReservas.java
 *
 * Created on 30/07/2009, 11:16:51 PM
 */

package pe.edu.cibertec.reservas.view.desk;

import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.JFrame;
import javax.swing.JInternalFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JScrollPane;
import pe.edu.cibertec.security.bean.Usuario;

/**
 *
 * @author Adrian
 */
public class MDIReservas extends JFrame {
  static Usuario usuario = null;
  private MDIDesktopPane desktop = new MDIDesktopPane();

  private JMenuBar menuBar = new JMenuBar();
  private JMenu transacMenu = new JMenu("Transacciones");
  private JMenu mantenMenu = new JMenu("Mantenimiento");
  private WindowMenu winMenu = new WindowMenu(desktop);

  private JMenuItem reservaMenuItem = new JMenuItem("Reserva Cancha");
  private JMenuItem canchaMenuItem = new JMenuItem("Cancha");
  private JMenuItem clienteMenuItem = new JMenuItem("Cliente");

  private JScrollPane scrollPane = new JScrollPane();
    /** Creates new form MDIReservas */
    public MDIReservas() {
        menuBar.add(transacMenu);
        menuBar.add(mantenMenu);
        menuBar.add(winMenu);
        transacMenu.add(reservaMenuItem);
        mantenMenu.add(canchaMenuItem);
        mantenMenu.add(clienteMenuItem);
        setJMenuBar(menuBar);
        setTitle("MDI Reservas");
        scrollPane.getViewport().add(desktop);
        getContentPane().setLayout(new BorderLayout());
        getContentPane().add(scrollPane, BorderLayout.CENTER);

       addWindowListener(new WindowAdapter() {
          public void windowClosing(WindowEvent e) {
              System.exit(0);
           }
        });
        reservaMenuItem.addActionListener(new ActionListener() {
             public void actionPerformed(ActionEvent ae) {
               desktop.add(new frmReservas());
             }
        });

        clienteMenuItem.addActionListener(new ActionListener() {
             public void actionPerformed(ActionEvent ae) {
               desktop.add(new frmCliente());
             }
        });

        canchaMenuItem.addActionListener(new ActionListener() {
             public void actionPerformed(ActionEvent ae) {
               desktop.add(new frmCancha());
             }
        });
        initComponents();
        dlgAuthentication dlgAutenticacion = new dlgAuthentication(this, true);
        dlgAutenticacion.setLocation(400,250);
        dlgAutenticacion.setVisible(true);
        this.setExtendedState(this.MAXIMIZED_BOTH);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        pack();
    }// </editor-fold>//GEN-END:initComponents

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new MDIReservas().setVisible(true);
            }
        });
    }



    // Variables declaration - do not modify//GEN-BEGIN:variables
    // End of variables declaration//GEN-END:variables

}
